import React, { useState } from "react";
import {
  WebView,
  View
} from '@tarojs/components';
import Taro, { useRouter, useDidShow, getCurrentInstance } from "@tarojs/taro";

const WebViewComponent = () => {
  const router = useRouter();
  const [url, setUrl] = useState('');
  useDidShow(()=>{
		let params = router.params;
    console.log('params', params)
    Taro.setNavigationBarTitle({
      title: params.name
    });
    setUrl(params.url)
	}, []);

  return (
    <View className='protocol_container'>
      <WebView
        src={url}
      />
    </View>
  )
}
export default WebViewComponent;
